package cn.wolfcode.qo;

import cn.wolfcode.Enum.ConsumptionReportEnums;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
@Getter
@Setter
public class ConsumptionReportQueryObject extends QueryObject {
    private String groupByName= ConsumptionReportEnums.BUSINESS.name();
    private Long businessId;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date statusDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    private Integer typeId;

    private String getGroupBy(){
        return ConsumptionReportEnums.valueOf(this.groupByName).getSql();
    }
}
